<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');

class Service_Controller extends CI_Controller {

	function __construct()
	{
		parent::__construct();

		$this->load->model('service_model');
	}

	public function index()
	{
		$data['service_list'] = $this->service_model->get_all_by_user_id($this->session->userdata('login_id'));
		$this->load->view('panel/service/index', $data);
	}

	public function show_create_form()
	{
		$this->load->view('panel/service/create_service_form');
	}

	public function create()
	{
		if(!$this->input->post()) redirect(PANEL_URL.'/service/show_create_form');
		
		$this->service_model->user_id = $this->session->userdata('login_id');
		$this->service_model->add_by_post($this->input->post());

		redirect(PANEL_URL . '/service');
	}
	
}

/* End of file service_controller.php */
/* Location: ./application/controllers/panel/service_controller.php */